/***
 * @description axios封装
 * @file api.ts
 * @author andy
 * @date 2024/3/22 16:40
 */
// file:api.s
// 1、导入axios以及拦截器
import service from './request'

// demo接口1
export const demo1 = (data: any) => {
    return service({
        url: '/user/user/demo1/' + data,
        method: 'post'
    })
};


// demo接口2
export const demo2 = (data: any) => {
    return service({
        url: '/user/user/demo2',
        method: 'post',
        data
    })
};
//注册
export const getReg = (data: any) => {
    return service({
        url: '/auth/user/getReg',
        method: 'post',
        data
    })
};
//登录
export const login = (data: any) => {
    return service({
        url: '/auth/user/login',
        method: 'post',
        data
    })
};
//商品列表
export const getProdList = (data: any) => {
    return service({
        url: '/prod/prod/getProdList',
        method: 'post',
        data
    })
};
//添加商品
export const addProdList = (data: any) => {
    return service({
        url: '/prod/prod/addProdList',
        method: 'post',
        data
    })
};
//添加商品附件
export const addAttaList = (data: any) => {
    return service({
        url: '/prod/atta/addAttaList',
        method: 'post',
        data
    })
};
//批量删除
export const deleteProdBatch = (data: any) => {
    return service({
        url: '/prod/prod/deleteProdBatch',
        method: 'post',
        data
    })
};
//品牌列表
export const getBrandList = (data: any) => {
    return service({
        url: '/prod/brand/getBrandList',
        method: 'post',
        data
    })
};
//添加品牌
export const addBrand = (data: any) => {
    return service({
        url: '/prod/brand/addBrand',
        method: 'post',
        data
    })
};
//修改品牌
export const updateBrand = (data: any) => {
    return service({
        url: '/prod/brand/updateBrand',
        method: 'post',
        data
    })
};
//商品类型列表
export const getTypeList = (data: any) => {
    return service({
        url: '/prod/type/getTypeList',
        method: 'post',
        data
    })
};
//添加商品类型
export const addTypeList = (data: any) => {
    return service({
        url: '/prod/type/addTypeList',
        method: 'post',
        data
    })
};
//发送验证码
export const sendPhoneCode = (userMobile: any) => {
    return service({
        url: '/auth/user/sendPhoneCode/' + userMobile,
        method: 'post'
    })
};
//通过typeId获取数据
export const getDictList = (typeId: any) => {
    return service({
        url: '/prod/dict/getDictList/' + typeId,
        method: 'post'
    })
};
//树形菜单
export const getTreeList = () => {
    return service({
        url: '/auth/user/getTreeList',
        method: 'post'
    })
};
//类型树
export const getSelectTypeListTree = () => {
    return service({
        url: '/prod/type/getSelectTypeListTree',
        method: 'post'
    })
};
//品牌名称下拉框
export const getBrand = () => {
    return service({
        url: '/prod/brand/getBrand',
        method: 'post'
    })
};
//订单列表
export const getOrderList = (data: any) => {
    return service({
        url: '/prod/order/getOrderList',
        method: 'post',
        data
    })
};
//订单批量删除
export const deleteOrderBatch = (data: any) => {
    return service({
        url: '/prod/order/deleteOrderBatch',
        method: 'post',
        data
    })
};
//商品下拉框
export const getProdInfoList = () => {
    return service({
        url: '/prod/order/getProdInfoList',
        method: 'post',
    })
};
//添加订单信息
export const addProdInfoList = (data: any) => {
    return service({
        url: '/prod/order/addProdInfoList',
        method: 'post',
        data
    })
};
//添加商品SKU
export const addProdInfoService = (data: any) => {
    return service({
        url: '/prod/prod/addProdInfo',
        method: 'post',
        data
    })
};
//订单详情查询
export const selectProdInfoService = () => {
    return service({
        url: '/prod/prod/selectProdInfo',
        method: 'post',
    })
};

//添加商品SKU
export const selectProdInfoByProdIdService = (data: any, prodId: any) => {
    return service({
        url: '/prod/prod/selectProdInfoByProdId/' + prodId,
        method: 'post',
        data
    })
};
// 查询商品详情
export const selectProdDetailService = (prodId: any) => {
    return service({
        url: '/prod/prod/selectProdDetail/' + prodId,
        method: 'post',
    })
};
//拼团活动列表
export const getGroupActiveList = (data: any) => {
    return service({
        url: '/prod/active/getGroupActiveList',
        method: 'post',
        data
    })
};
//添加拼团活动列表
export const addGroupActive = (data: any) => {
    return service({
        url: '/prod/active/addGroupActive',
        method: 'post',
        data
    })
};
//单删拼团活动
export const deleteActive = (activeId: any) => {
    return service({
        url: '/prod/active/deleteActive/' + activeId,
        method: 'post',
    })
};
//修改拼团活动
export const updateActive = (data: any) => {
    return service({
        url: '/prod/active/updateActive',
        method: 'post',
        data
    })
};
//参与活动列表
export const getGroupInfoList = (data: any) => {
    return service({
        url: '/prod/join/getGroupInfoList',
        method: 'post',
        data
    })
};
//添加参与活动
export const addGroupInfo = (data: any) => {
    return service({
        url: '/prod/join/addGroupInfo',
        method: 'post',
        data
    })
};
//查找拼团
export const selectGroupActive = () => {
    return service({
        url: '/prod/active/selectGroupActive',
        method: 'post',
    })
};
//修改参与活动
export const updateGroupInfo = (data: any) => {
    return service({
        url: '/prod/join/updateGroupInfo',
        method: 'post',
        data
    })
};
//删除参与活动
export const deleteGroupJoin = (joinId: any) => {
    return service({
        url: '/prod/join/deleteGroupJoin/' + joinId,
        method: 'post',
    })
};
//参与拼团列表
export const getGroupList = (data: any) => {
    return service({
        url: '/prod/group/getGroupList',
        method: 'post',
        data
    })
};
//我的拼团列表
export const getGroupOrderList = (data: any) => {
    return service({
        url: '/prod/GroupOrder/getGroupOrderList',
        method: 'post',
        data
    })
};
//取消订单
export const deleteOrder = (orderId: any) => {
    return service({
        url: '/prod/GroupOrder/deleteOrder/' + orderId,
        method: 'post',
    })
};
//活动列表
export const getActiveList = (data: any) => {
    return service({
        url: '/prod/activeList/getActiveList',
        method: 'post',
        data
    })
};
//添加活动
export const addActive = (data: any) => {
    return service({
        url: '/prod/activeList/addActive',
        method: 'post',
        data
    })
};
//修改活动
export const updateActiveList = (data: any) => {
    return service({
        url: '/prod/activeList/updateActiveList',
        method: 'post',
        data
    })
};
//删除活动
export const deleteActiveList = (actId: any) => {
    return service({
        url: '/prod/activeList/deleteActiveList/' + actId,
        method: 'post',
    })
};

